FROM python:3.12-slim

# 设置工作目录
WORKDIR /app

COPY sources.list  /etc/apt
COPY debian.sources /etc/apt/sources.list.d

# 安装系统依赖
RUN apt-get update && apt-get install -y python3-distutils && \
    rm -rf /var/lib/apt/lists/*

# 安装 Python 依赖
COPY requirements.txt .
RUN  python3 -m pip install --upgrade pip -i https://pypi.tuna.tsinghua.edu.cn/simple && \
     pip3 install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple

# 复制代码
COPY . .

# 创建必要的目录
RUN mkdir -p /app/data/text_detection/input \
    /app/data/text_detection/output \
    /app/data/text_detection/statistics \
    /app/data/model_check/input \
    /app/data/model_check/output \
    /app/data/model_check/statistics \
    /app/logs

# 设置环境变量
ENV PYTHONPATH=/app

# 启动命令
CMD ["python3", "run.py"] 